<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子浮动</title>
    <style>
        .a1 {
            width: 50px;
            height: 200px;
            border: 3px solid blue;
            box-sizing: border-box;
            float: left;
            clear: both;
        }

        .a2 {
            width: 50px;
            height: 100px;
            border: 3px solid green;
            box-sizing: border-box;
            float: left;
        }

        .a3 {
            width: 50px;
            height: 100px;
            border: 3px solid red;
            box-sizing: border-box;
            float: left;
        }

        .a4 {
            width: 100px;
            height: 100px;
            border: 3px solid black;
            box-sizing: border-box;
            float: left;
            /* 清除浮动clear: left; */
        }
        .a5 {
            width: 150px;
            height: 198px;
            border: 0px solid rgb(218, 15, 218);
            /* 使用空标记  clear：both */
            /*   overflow属性清除浮动   overflow: hidden; */
            /* after属性 */
        }
    </style>
</head>

<body>
    <div class="a5">
        <div class="a1"></div>
        <div class="a2"></div>
        <div class="a3"></div>
        <div class="a4"></div>
    </div>
   
</body>

</html>